﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace M2B.GestionEntretiens
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            //.axd files don't exist physically. ASP.NET uses URLs with .axd extensions 
            //(ScriptResource.axd and WebResource.axd) internally, and they are handled by an HttpHandler.
            //Therefore, you should keep this rule, or users will be able to download the .axd "files", which you don't want.

            //http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx/

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}